package com.ruoyi.web.tdmdata.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.tdmdata.mapper.TdmYiYiLiaoQiXieMapper;
import com.ruoyi.web.tdmdata.domain.TdmYiYiLiaoQiXie;
import com.ruoyi.web.tdmdata.service.ITdmYiYiLiaoQiXieService;

/**
 * 医疗器械Service业务层处理
 * 
 * @author ly
 * @date 2022-03-14
 */
@Service
public class TdmYiYiLiaoQiXieServiceImpl implements ITdmYiYiLiaoQiXieService 
{
    @Autowired
    private TdmYiYiLiaoQiXieMapper tdmYiYiLiaoQiXieMapper;

    /**
     * 查询医疗器械
     * 
     * @param id 医疗器械主键
     * @return 医疗器械
     */
    @Override
    public TdmYiYiLiaoQiXie selectTdmYiYiLiaoQiXieById(Long id)
    {
        return tdmYiYiLiaoQiXieMapper.selectTdmYiYiLiaoQiXieById(id);
    }

    /**
     * 查询医疗器械列表
     * 
     * @param tdmYiYiLiaoQiXie 医疗器械
     * @return 医疗器械
     */
    @Override
    public List<TdmYiYiLiaoQiXie> selectTdmYiYiLiaoQiXieList(TdmYiYiLiaoQiXie tdmYiYiLiaoQiXie)
    {
        return tdmYiYiLiaoQiXieMapper.selectTdmYiYiLiaoQiXieList(tdmYiYiLiaoQiXie);
    }

    /**
     * 新增医疗器械
     * 
     * @param tdmYiYiLiaoQiXie 医疗器械
     * @return 结果
     */
    @Override
    public int insertTdmYiYiLiaoQiXie(TdmYiYiLiaoQiXie tdmYiYiLiaoQiXie)
    {
        tdmYiYiLiaoQiXie.setCreateTime(DateUtils.getNowDate());
        return tdmYiYiLiaoQiXieMapper.insertTdmYiYiLiaoQiXie(tdmYiYiLiaoQiXie);
    }

    /**
     * 修改医疗器械
     * 
     * @param tdmYiYiLiaoQiXie 医疗器械
     * @return 结果
     */
    @Override
    public int updateTdmYiYiLiaoQiXie(TdmYiYiLiaoQiXie tdmYiYiLiaoQiXie)
    {
        tdmYiYiLiaoQiXie.setUpdateTime(DateUtils.getNowDate());
        return tdmYiYiLiaoQiXieMapper.updateTdmYiYiLiaoQiXie(tdmYiYiLiaoQiXie);
    }

    /**
     * 批量删除医疗器械
     * 
     * @param ids 需要删除的医疗器械主键
     * @return 结果
     */
    @Override
    public int deleteTdmYiYiLiaoQiXieByIds(Long[] ids)
    {
        return tdmYiYiLiaoQiXieMapper.deleteTdmYiYiLiaoQiXieByIds(ids);
    }

    /**
     * 删除医疗器械信息
     * 
     * @param id 医疗器械主键
     * @return 结果
     */
    @Override
    public int deleteTdmYiYiLiaoQiXieById(Long id)
    {
        return tdmYiYiLiaoQiXieMapper.deleteTdmYiYiLiaoQiXieById(id);
    }
}
